package com.ruoyi.ax.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ax.mapper.AxRechargeRuleMapper;
import com.ruoyi.ax.domain.AxRechargeRule;
import com.ruoyi.ax.service.IAxRechargeRuleService;

/**
 * 充值规则Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-07
 */
@Service
public class AxRechargeRuleServiceImpl implements IAxRechargeRuleService 
{
    @Autowired
    private AxRechargeRuleMapper axRechargeRuleMapper;

    /**
     * 查询充值规则
     * 
     * @param id 充值规则主键
     * @return 充值规则
     */
    @Override
    public AxRechargeRule selectAxRechargeRuleById(Long id)
    {
        return axRechargeRuleMapper.selectAxRechargeRuleById(id);
    }

    /**
     * 查询充值规则列表
     * 
     * @param axRechargeRule 充值规则
     * @return 充值规则
     */
    @Override
    public List<AxRechargeRule> selectAxRechargeRuleList(AxRechargeRule axRechargeRule)
    {
        return axRechargeRuleMapper.selectAxRechargeRuleList(axRechargeRule);
    }

    /**
     * 新增充值规则
     * 
     * @param axRechargeRule 充值规则
     * @return 结果
     */
    @Override
    public int insertAxRechargeRule(AxRechargeRule axRechargeRule)
    {
        axRechargeRule.setCreateTime(DateUtils.getNowDate());
        return axRechargeRuleMapper.insertAxRechargeRule(axRechargeRule);
    }

    /**
     * 修改充值规则
     * 
     * @param axRechargeRule 充值规则
     * @return 结果
     */
    @Override
    public int updateAxRechargeRule(AxRechargeRule axRechargeRule)
    {
        axRechargeRule.setUpdateTime(DateUtils.getNowDate());
        return axRechargeRuleMapper.updateAxRechargeRule(axRechargeRule);
    }

    /**
     * 批量删除充值规则
     * 
     * @param ids 需要删除的充值规则主键
     * @return 结果
     */
    @Override
    public int deleteAxRechargeRuleByIds(Long[] ids)
    {
        return axRechargeRuleMapper.deleteAxRechargeRuleByIds(ids);
    }

    /**
     * 删除充值规则信息
     * 
     * @param id 充值规则主键
     * @return 结果
     */
    @Override
    public int deleteAxRechargeRuleById(Long id)
    {
        return axRechargeRuleMapper.deleteAxRechargeRuleById(id);
    }
}
